# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=meowdict
pkgver=0.10.5
pkgrel=1
pkgdesc="CLI web client for moedict.tw"
url="https://github.com/eatradish/meowdict"
arch="all"
license="MIT"
depends="opencc"
makedepends="
	cargo
	cargo-auditable
	opencc-dev
	openssl-dev
	"
source="https://github.com/eatradish/meowdict/archive/v$pkgver/meowdict-$pkgver.tar.gz
	getrandom-0.2.15.patch
	nix-0.28.0.patch
	remove-rustix-0.36.10.patch
	update-test_wordshk_api_result.patch
	"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dvm755 target/release/meowdict -t "$pkgdir"/usr/bin/

	install -Dvm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
2af8e39e6fa6c3dc54a38993f59bef4b893255b9dc05c47af6bd3fd2f61654f8768b748c33f9f623a255e73e0d06f9301d15390cfeee09466015daaaab457698  meowdict-0.10.5.tar.gz
54a7cb097241320abd5568de61215f68fbbe063dc433fbda4988370ffcf20e942a89d35bfec83f897d331359493a19d99d49dc28cc7762538cd8d85170716261  getrandom-0.2.15.patch
a4ecda37f88cc2ea6bcf799ec76246ad9b7fa680c4c92431494bd371859386a3b26b95e10ddda85702796f050212e4e2124380948813b8539fea19c701ab4fc8  nix-0.28.0.patch
2e6360dadba7f25a14504325135cfca5ff6f7d601980bc8eefeb306c8969381dd34ebe33b1c705f71c4e8057ae75364824c8dd75c2cf0f1a5b62f1bc2ca5dc1e  remove-rustix-0.36.10.patch
e60d3a67004154c683a402fc18e0fb31db0ffa42b155ffb18b620a97090771584217e0ed30d3dc84068278ee774ce7d712915c59f48d1195470bb42ba2c0efd6  update-test_wordshk_api_result.patch
"
